<?php

namespace App\Jobs;

use App\Services\WxtjArticle;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;

class WxtjArticleUserreadhourHandle implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    /**
     * 开始时间
     * @var string
     */
    private $beginDate;
    /**
     * 结束时间
     * @var string
     */
    private $endDate;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct($beginDate, $endDate)
    {
        $this->beginDate = $beginDate;
        $this->endDate = $endDate;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle(WxtjArticle $wxtjArticle)
    {
        $wxtjArticle->pullUserReadHour($this->beginDate, $this->endDate);
    }
}
